package com.zyx.maildemo.controller;

import com.zyx.maildemo.utils.RestResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @AUTHOR soft
 * @DATE 2018/11/29 11:40
 * @DESCRIBE
 */
@Controller
public class InfoController {

    @ResponseBody
    @RequestMapping("/login0")
    public RestResponse login() {
        return RestResponse.fail(403, "请先登录");
    }

    @ResponseBody
    @RequestMapping("/success")
    public RestResponse success() {
        return RestResponse.ok("允许访问");
    }

    @ResponseBody
    @RequestMapping("/unauth")
    public RestResponse unauth() {
        return RestResponse.fail(402, "没有访问权限");
    }
}
